package com.rmd.dl.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.rmd.dl.service.UserService;

import net.sf.json.JSONObject;


@Controller
@RequestMapping("user")
public class UserAction {
	
	@Autowired
	private UserService userService;
	
	@ResponseBody
	@RequestMapping("/userList")
	public JSONObject userList() throws Exception {//@RequestBody UserDTO userDTO
		JSONObject josnObject = new JSONObject();
		josnObject.put("message","HelloWorld");
		return userService.list();
		//return josnObject;
	}
	
	@RequestMapping("/hello")
	public String hello() throws Exception {
		return "hello";
	}
	
}

